home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / OutOfPhase1.01Source / OutOfPhase Folder / FunctionObject.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-01  |  3.5 KB  |  101 lines  |  [TEXT/KAHL]

  1. /* FunctionObject.h */
  2.  
  3. #ifndef Included_FunctionObject_h
  4. #define Included_FunctionObject_h
  5.  
  6. /* FunctionObject module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Memory */
  12. /* DataMunging */
  13. /* CodeCenter */
  14. /* Numbers */
  15. /* Alert */
  16. /* Array */
  17. /* PcodeDisassembly */
  18. /* CompilerRoot */
  19. /* FunctionCode */
  20. /* MainWindowStuff */
  21. /* BufferedFileInput */
  22. /* BufferedFileOutput */
  23.  
  24. #include "MainWindowStuff.h"
  25.  
  26. struct FunctionObjectRec;
  27. typedef struct FunctionObjectRec FunctionObjectRec;
  28.  
  29. /* forward declarations */
  30. struct CodeCenterRec;
  31. struct MainWindowRec;
  32. struct FunctionListRec;
  33. struct BufferedInputRec;
  34. struct BufferedOutputRec;
  35.  
  36. /* create a new empty function object */
  37. FunctionObjectRec*    NewFunctionObject(struct CodeCenterRec* CodeCenter,
  38.                                             struct MainWindowRec* MainWindow,
  39.                                             struct FunctionListRec* FuncList);
  40.  
  41. /* get rid of the function object */
  42. void                                DisposeFunctionObject(FunctionObjectRec* FuncObj);
  43.  
  44. /* inquire whether the function has been modified */
  45. MyBoolean                        HasFunctionObjectBeenModified(FunctionObjectRec* FuncObj);
  46.  
  47. /* build the function module code.  returns True if successful. */
  48. MyBoolean                        FunctionObjectBuild(FunctionObjectRec* FuncObj);
  49.  
  50. /* unconditionally unbuild the functions */
  51. void                                FunctionObjectUnbuild(FunctionObjectRec* FuncObj);
  52.  
  53. /* build the functions if necessary.  return True if successful. */
  54. MyBoolean                        FunctionObjectMakeUpToDate(FunctionObjectRec* FuncObj);
  55.  
  56. /* return a text block containing a disassembly of the function module */
  57. char*                                FunctionObjectDisassemble(FunctionObjectRec* FuncObj);
  58.  
  59. /* get a copy of the name of this function module, no null termination */
  60. char*                                FunctionObjectGetNameCopy(FunctionObjectRec* FuncObj);
  61.  
  62. /* open the window for this function */
  63. MyBoolean                        FunctionObjectOpenWindow(FunctionObjectRec* FuncObj);
  64.  
  65. /* get the text for this function */
  66. char*                                FunctionObjectGetSourceCopy(FunctionObjectRec* FuncObj);
  67.  
  68. /* install new data in the object.  this is used when the editor window closes, */
  69. /* to put the new data into this object.  the object becomes the owner of Data, */
  70. /* so the caller should not release it. */
  71. void                                FunctionObjectNewSource(FunctionObjectRec* FuncObj, char* Data);
  72.  
  73. /* give function module a new name.  the object becomes the owner of Name, so */
  74. /* the caller should not release it. */
  75. void                                FunctionObjectNewName(FunctionObjectRec* FuncObj, char* Name);
  76.  
  77. /* this is called when the window is closing.  it notifies the object.  the */
  78. /* object should not take any action. */
  79. void                                FunctionObjectClosingWindowNotify(FunctionObjectRec* FuncObj,
  80.                                             short NewWindowX, short NewWindowY, short NewWindowWidth,
  81.                                             short NewWindowHeight);
  82.  
  83. /* the document's name has changed, so we need to update the window */
  84. void                                FunctionObjectGlobalNameChange(FunctionObjectRec* FuncObj,
  85.                                             char* NewFilename);
  86.  
  87. /* create a new object initialized with data read in from a file. */
  88. FileLoadingErrors        FunctionObjectNewFromFile(FunctionObjectRec** ObjectOut,
  89.                                             struct BufferedInputRec* Input, struct CodeCenterRec* CodeCenter,
  90.                                             struct MainWindowRec* MainWindow,
  91.                                             struct FunctionListRec* FuncList);
  92.  
  93. /* write the data in an object out to disk */
  94. FileLoadingErrors        FunctionObjectWriteOutData(FunctionObjectRec* FuncObj,
  95.                                             struct BufferedOutputRec* Output);
  96.  
  97. /* mark all items in the function object as not changed */
  98. void                                FunctionObjectMarkAsSaved(FunctionObjectRec* FuncObj);
  99.  
  100. #endif
  101.